package com.ttbj.core.model;

/**
 * EasyUI 分页帮助类
 * 
 * @author Daniel
 * 
 */
public class PageHelper implements java.io.Serializable {
	
	private static final long serialVersionUID = -4436120457312967296L;
	/** 当前页 */
	private Integer page;
	/** 每页显示记录数 */
	private Integer rows;
	/** 排序字段 */
	private String sort;
	/** 排序类型：asc、desc */
	private String order;
	/** 记录开始的index */
	private Integer pageStart;

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getRows() {
		return rows;
	}

	public void setRows(Integer rows) {
		this.rows = rows;
		setPageIndex();
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public Integer getPageStart() {
		return pageStart;
	}

	public void setPageStart(Integer pageStart) {
		this.pageStart = pageStart;
	}

	/**
	 * limit 开始index设置
	 * 
	 * @author Daniel
	 * @date 2017年4月14日 下午5:23:34
	 * 
	 */
	public void setPageIndex() {
		this.pageStart = (this.page - 1) * this.rows;
	}

}
